Make specs pass

Daniel O'Connor 10 years ago
parent
commit
efcd63ea96
2 changed files with 3 additions and 2 deletions
  1. 1 1
      app/models/agents/mqtt_agent.rb
  2. 2 1
      spec/models/agents/mqtt_agent_spec.rb

+ 1 - 1
app/models/agents/mqtt_agent.rb

@@ -74,7 +74,7 @@ module Agents
74 74
     end
75 75
 
76 76
     def working?
77
-      !recent_error_logs?
77
+      event_created_within?(options['expected_update_period_in_days']) && !recent_error_logs?
78 78
     end
79 79
 
80 80
     def default_options

+ 2 - 1
spec/models/agents/mqtt_agent_spec.rb

@@ -18,7 +18,8 @@ describe Agents::MqttAgent do
18 18
 		@valid_params = {
19 19
       'uri' => "mqtt://#{@server.address}:#{@server.port}",
20 20
       'topic' => '/#',
21
-      'max_read_time' => 1
21
+      'max_read_time' => 1,
22
+      'expected_update_period_in_days' => "2"
22 23
     }
23 24
 
24 25
 		@checker = Agents::MqttAgent.new(